import requests
from config import url, headers_web

class Teacher:
    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def post_updateactivestatus(cls,url:str,params=None,json=None,headers=headers_web):
        '''
        @Summary:老师上课更新当前教室或当前老师的所有用户活动状态为：异常
        @Description:互动课堂调用
        :param url:
        :param params:
        :param json:
        :return:
        '''
        url = url + "/teachingApi/v1/teacher/updateactivestatus"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r

    @classmethod
    def post_currentCourseInformation(cls,url:str,params=None,json=None,headers=headers_web):
        '''
        @Summary:创建老师上课信息接口；判断是否存在上课中的课程信息，存在则不生成上课信息
        @Description:云课堂调用
        :param url:
        :param params:
        :param json:
        :return:
        '''
        url = url + "/teachingApi/v1/teacher/currentCourseInformation"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r

if __name__ == '__main__':
    params = {"validCode":"155cc6439a2bd898c289a0a86ee1058c"}
    json = {
      "teacherName": "李玉平",
      "courseCode": "1122108",
      "courseTableId": "297ead2e85996f7401860e078752052d",
      "groupId": "202220232112210809",
      "collegeCode": "013",
      "teacherNo": "2008115582",
      "classTimesNum": None,
      "roomId": "S1311",
      "roomName": "S1311",
      "collegeName": "生命科学学院",
      "termId": "2022-2023-2",
      "courseName": "植物学实验",
      "groupName": "植物学实验[09]",
      "teacherId": "00cb0733-024b-42e3-9504-46325c36c5be",
      "collegeId": "013",
      "schoolYear": "2022-2023",
      "term": "2",
      "termStartTime": "2023-02-06",
      "id": None,
      "termEndTime": "2024-05-20",
      "courseId": "1122108",
      "courseTableDetailId": None,
      "groupNo": "202220232112210809"
    }
    r = Teacher.post_currentCourseInformation(url=url,params=params,json=json)
    print(r)